package org.rabbitmq.rabbitmqspringboot.listener;

import org.rabbitmq.rabbitmqspringboot.constant.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消息 接收者
 */
@Component
public class WorkListener {

    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void queueListener1(Message message){
        System.out.println("listener 1["+Constants.WORK_QUEUE+"] 接收消息: "+message);
    }

    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void queueListener2(String message){
        System.out.println("listener 1["+Constants.WORK_QUEUE+"] 接收消息: "+message);
    }


}
